package com.maimao.goods.client;

import com.maimao.core.constant.ServiceContainer;
import com.maimao.core.interceptor.FeignInterceptor;
import com.maimao.core.model.resp.Result;
import com.maimao.goods.client.factory.EsDocFallBackFactory;
import com.maimao.goods.client.factory.EsFallBackFactory;
import com.maimao.model.goods.log.GoodsCheck;
import com.maimao.model.goods.log.GoodsCheckInput;
import com.maimao.model.search.DocInput;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author MaoLin Wang
 * @date 2020/12/22 7:54 下午
 */
@FeignClient(contextId = "esClient", value = ServiceContainer.SEARCH_SERVICE, fallbackFactory = EsFallBackFactory.class, configuration = FeignInterceptor.class)
public interface EsClient {

    @PostMapping("/goodsCheck/save")
    Result save(@RequestBody @Validated GoodsCheck goodsCheck);


    @PostMapping("/goodsCheck/list")
    Result list(@RequestBody GoodsCheckInput checkInput);

    @PostMapping("/goodsCheck/updateStatus")
    Result updateStatus(@RequestBody GoodsCheck goodsCheck);
}
